//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.purvar.boot.comm.core.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.purvar.boot.comm.api.vo.PageQuery;
import com.purvar.boot.comm.api.vo.Result;

public class BaseServiceImpl<M extends BaseMapper<T>, T> extends ServiceImpl<M, T> {
    public BaseServiceImpl() {
    }

    public Result<IPage<T>> pageQuery(PageQuery<T> tPageQuery, QueryWrapper<T> queryWrapper) {
        Result<IPage<T>> result = new Result();
        Page<T> page = new Page((long) tPageQuery.getPageNo(), (long) tPageQuery.getPageSize());
        result.setSuccess(true);
        IPage<T> pageList = this.page(page, queryWrapper);
        result.setResult(pageList);
        return result;
    }
}
